# your_app_name/urls.py

from django.urls import path
from . import views, views_product_lot_rels, views_product_info, views_user

urlpatterns = [
    path('', views_product_lot_rels.product_lot_rel_list, name='index'),
    path('process_config', views.process_config, name='process_config'),
    # 创建product lot rel
    path('create_product_lot_rel/', views_product_lot_rels.create_product_lot_rel, name='create_product_lot_rel'),
    path('product_lot_rel_list/', views_product_lot_rels.product_lot_rel_list, name='product_lot_rel_list'),
    path('product_lot_rel/delete/<int:pk>/', views_product_lot_rels.delete_product_lot_rel,
         name='delete_product_lot_rel'),
    path('product_lot_rel/upload/', views_product_lot_rels.upload_excel, name='product_lot_rel_upload_excel'),

    # 批次产品信息管理
    path('product_batch_info_list/', views_product_info.product_batch_info_list, name='product_batch_info_list'),
    path('add_product_base_info/', views_product_info.add_product_base_info, name='add_product_base_info'),
    path('edit_product_base_info/<int:id>/', views_product_info.edit_product_base_info, name='edit_product_base_info'),
    path('do_auto_generate_report/<int:id>/', views_product_info.do_auto_generate_report,
         name='do_auto_generate_report'),
    path('delete_product_base_info/<int:id>/', views_product_info.delete_product_base_info,
         name='delete_product_base_info'),
    path('delete_download_file/', views_product_info.delete_download_file, name='delete_download_file'),
    path('product_upload_file/', views_product_info.upload_file, name='product_upload_file'),

    # 用户管理
    path('users/', views_user.user_list, name='user_list'),
    path('users/add/', views_user.add_user, name='add_user'),
    path('users/delete/<int:user_id>/', views_user.confirm_delete_user, name='confirm_delete_user'),
    path('users/change_password/<int:user_id>/', views_user.change_password, name='change_password'),
    path('login/', views_user.login_view, name='login'),
    path('logout/', views_user.logout_view, name='logout'),
]
